﻿using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Silverlight3dApp.Learning.Lesson07
{
    public class RunningEnemy : BasicModel
    {
        protected Matrix _Translation = Matrix.Identity;
        protected Matrix _Rotation = Matrix.CreateRotationY(MathHelper.Pi - MathHelper.PiOver4);

        public Matrix Translation
        {
            get
            {
                return _Translation;
            }
        }

        public RunningEnemy(Model model) : base(model)
        {
        }

        public override void Update()
        {
            _Translation *= Matrix.CreateTranslation(0.5f, 0, -0.5f);
            base.Update();
        }

        public override Matrix World
        {
            get
            {
                return base.World * _Rotation * _Translation;
            }
        }
    }
}